package com.itheima.tlias.mapper;

import com.itheima.tlias.model.entity.Dept;
import com.itheima.tlias.mapper.sql.DeptMapperSqlProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author byzhao
 * @created 2024-04-05 16:42:26
 * @describtion 部门的Mapper 接口
 *
 * @Mapper  标记当前接口是一个Mapper 接口
 *
 */

@Mapper
public interface DeptMapper {
    @UpdateProvider(type = DeptMapperSqlProvider.class,method = "updata")
    void updata(Dept dept);
    @SelectProvider(type = DeptMapperSqlProvider.class,method = "deptById")
    Dept deptById(Integer id);

    /**
     *  添加部门
     * @param dept
     */
    @InsertProvider(type = DeptMapperSqlProvider.class,method = "insertDept")
    void insertDept(Dept dept);

    /**
     *  根据部门id删除部门
     * @param id 部门id
     */
    @DeleteProvider(type = DeptMapperSqlProvider.class,method = "deleteById")
    void deleteById(int id);


    /**
     *
     *  查询部门列表
     *
     * @return List<Dept>
     */
    @SelectProvider(type = DeptMapperSqlProvider.class,method = "selectDepts")
    List<Dept> selectDepts();



}
